<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>${constants.getSystemName()}</title>
    <link rel="stylesheet" href="${ctxPath}/assets/common/libs/layui/css/layui.css?v=${constants.getReleaseVersion()}"/>
    <link rel="stylesheet" href="${ctxPath}/assets/common/module/admin.css?v=${constants.getReleaseVersion()}"/>
    <link rel="stylesheet" href="${ctxPath}/assets/expand/css/style.css?v=${constants.getReleaseVersion()}" media="all"/>

    <style>
        /** 应用快捷块样式 */
        .console-app-group {
            padding: 16px;
            border-radius: 4px;
            text-align: center;
            background-color: #fff;
            cursor: pointer;
            display: block;
        }

        .console-app-group .console-app-icon {
            width: 32px;
            height: 32px;
            line-height: 32px;
            margin-bottom: 6px;
            display: inline-block;
            -webkit-box-sizing: border-box;
            -moz-box-sizing: border-box;
            box-sizing: border-box;
            font-size: 32px;
            color: #69c0ff;
        }

        .console-app-group:hover {
            box-shadow: 0 0 15px rgba(0, 0, 0, .08);
        }

        /** //应用快捷块样式 */

        /** 小组成员 */
        .console-user-group {
            position: relative;
            padding: 10px 0 10px 60px;
        }

        .console-user-group .console-user-group-head {
            width: 32px;
            height: 32px;
            position: absolute;
            top: 50%;
            left: 12px;
            margin-top: -16px;
            border-radius: 50%;
        }

        .console-user-group .layui-badge {
            position: absolute;
            top: 50%;
            right: 8px;
            margin-top: -10px;
        }

        .console-user-group .console-user-group-name {
            line-height: 1.2;
        }

        .console-user-group .console-user-group-desc {
            color: #8c8c8c;
            line-height: 1;
            font-size: 12px;
            margin-top: 5px;
        }

        /** 卡片轮播图样式 */
        .admin-carousel .layui-carousel-ind {
            position: absolute;
            top: -41px;
            text-align: right;
        }

        .admin-carousel .layui-carousel-ind ul {
            background: 0 0;
        }

        .admin-carousel .layui-carousel-ind li {
            background-color: #e2e2e2;
        }

        .admin-carousel .layui-carousel-ind li.layui-this {
            background-color: #999;
        }

        /** 广告位轮播图 */
        .admin-news .layui-carousel-ind {
            height: 45px;
        }

        .admin-news a {
            display: block;
            line-height: 70px;
            text-align: center;
        }

        /** 最新动态时间线 */
        .layui-timeline-dynamic .layui-timeline-item {
            padding-bottom: 0;
        }

        .layui-timeline-dynamic .layui-timeline-item:before {
            top: 16px;
        }

        .layui-timeline-dynamic .layui-timeline-axis {
            width: 9px;
            height: 9px;
            left: 1px;
            top: 7px;
            background-color: #cbd0db;
        }

        .layui-timeline-dynamic .layui-timeline-axis.active {
            background-color: #0c64eb;
            box-shadow: 0 0 0 2px rgba(12, 100, 235, .3);
        }

        .dynamic-card-body {
            box-sizing: border-box;
            overflow: hidden;
        }

        .dynamic-card-body:hover {
            overflow-y: auto;
            padding-right: 9px;
        }

        /** 优先级徽章 */
        .layui-badge-priority {
            border-radius: 50%;
            width: 20px;
            height: 20px;
            padding: 0;
            line-height: 18px;
            border-width: 2px;
            font-weight: 600;
        }
    </style>
</head>

<body>

<!-- 加载动画，移除位置在common.js中 -->
<div class="page-loading">
    <div class="ball-loader">
        <span></span><span></span><span></span><span></span>
    </div>
</div>

<!-- 正文开始 -->
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-xs12 layui-col-sm6 layui-col-md3">
            <div class="layui-card">
<!--                <div class="layui-form-item">-->
<!--                    <blockquote class="layui-elem-quote layui-quote-nm">-->
<!--                        <div class="layui-inline">-->
<!--                            <h3>塔吊：<span id='towenCount'></span></h3>-->
<!--                        </div>-->
<!--                        <div class="layui-inline">-->
<!--                            <h3>升降机：<span id='liftCount'></span></h3>-->
<!--                        </div>-->
<!--                        <div class="layui-inline">-->
<!--                            <h3>用电检测：<span id='eleCount'></span></h3>-->
<!--                        </div>-->
<!--                        <div class="layui-inline">-->
<!--                            <h3>Al服务器：<span id='alCount'></span></h3>-->
<!--                        </div>-->
<!--                        <div class="layui-inline">-->
<!--                            <h3>摄像头：<span id='monitorCount'></span></h3>-->
<!--                        </div>-->
<!--                        <div class="layui-inline">-->
<!--                            <h3>吊钩可视化：<span id='hookCount'></span></h3>-->
<!--                        </div>-->
<!--                    </blockquote>-->
<!--                </div>-->

                <div class="layui-card-body">
                    <h3>塔吊总数：<span class="lay-big-font" id="towenCount"></span></h3>
                </div>
            </div>
        </div>
        <div class="layui-col-xs12 layui-col-sm6 layui-col-md3">
            <div class="layui-card">

                <div class="layui-card-body">
                    <h3>升降机总数：<span class="lay-big-font" id="liftCount"></span></h3>
<!--                    <p>总销售额<span class="pull-right">68 万</span></p>-->
                </div>
            </div>
        </div>
        <div class="layui-col-xs12 layui-col-sm6 layui-col-md3">
            <div class="layui-card">

                <div class="layui-card-body">
                    <h3>用电检测总数：<span class="lay-big-font" id="eleCount"></span></h3>
<!--                    <p>转化率<span class="pull-right">60%</span></p>-->
                </div>
            </div>
        </div>
        <div class="layui-col-xs12 layui-col-sm6 layui-col-md3">
            <div class="layui-card">

                <div class="layui-card-body">
                    <h3>Al服务器：<span class="lay-big-font" id="alCount"></span></h3>
                    <!--                    <p>转化率<span class="pull-right">60%</span></p>-->
                </div>
            </div>
        </div>
        <div class="layui-col-xs12 layui-col-sm6 layui-col-md3">
            <div class="layui-card">

                <div class="layui-card-body">
                    <h3>摄像头：<span class="lay-big-font" id="monitorCount"></span></h3>
                    <!--                    <p>转化率<span class="pull-right">60%</span></p>-->
                </div>
            </div>
        </div>

        <div class="layui-col-xs12 layui-col-sm6 layui-col-md3">
            <div class="layui-card">

                <div class="layui-card-body">
                    <h3>吊钩可视化：<span class="lay-big-font" id="hookCount"></span></h3>
                    <!--                    <p>转化率<span class="pull-right">60%</span></p>-->
                </div>
            </div>
        </div>


    </div>
    <!-- 快捷方式 -->
    <div class="layui-row layui-col-space15">
        <div class="layui-col-sm6" style="padding-bottom: 0;">
            <div class="layui-row layui-col-space15">
            </div>
        </div>
    </div>


</div>

<!-- js部分 -->
@/* 加入contextPath属性和session超时的配置 */
<script type="text/javascript">
    var Feng = {
        ctxPath: "${ctxPath}",
        version: '${constants.getReleaseVersion()}'
    };
</script>

<script type="text/javascript" src="${ctxPath}/assets/common/libs/layui/layui.js?v=${constants.getReleaseVersion()}"></script>
<script type="text/javascript" src="${ctxPath}/assets/common/js/common.js?v=${constants.getReleaseVersion()}"></script>

<script>
    layui.use(['layer', 'carousel'], function () {
        var $ = layui.jquery;
        var layer = layui.layer;
        var carousel = layui.carousel;
        var device = layui.device;

        $.ajax({
            url: Feng.ctxPath + '/device/statistics',
            dataType: 'json',
            type: 'get',
            success: function (data) {
                console.log(data);//下面会提到这个data是什么值

                $("#towenCount").html(data.data.towenCount);
                $("#liftCount").html(data.data.liftCount);
                $("#hookCount").html(data.data.hookCount);
                $("#alCount").html(data.data.alCount);
                $("#monitorCount").html(data.data.monitorCount);
                $("#eleCount").html(data.data.eleCount);
            }
        })

        // 渲染轮播
        carousel.render({
            elem: '.layui-carousel',
            width: '100%',
            height: '60px',
            arrow: 'none',
            autoplay: true,
            trigger: device.ios || device.android ? 'click' : 'hover',
            anim: 'fade'
        });
    });




</script>
</body>

</html>